package com.mapper;

import com.pojo.GongYi_x;
import com.pojo.JingXuan_x;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface JingXuanMapper_x {
    @Select("select * from jingxuan_x")
    public List<JingXuan_x> selectAll();
    @Select("select * from jingxuan_x where del =1")
    public List<JingXuan_x> select1();

    @Select("select * from jingxuan_x j right join wenzhang_db w on j.id = w.w_id where w.t_id = #{tId} and j.del = 1")
    List<JingXuan_x> listById(Integer tId);

    @Insert("insert into jingxuan_x (title,img,del,content) values (#{title},#{img},#{del},#{content})")
    Integer add(JingXuan_x jingXuanX);

    @Update("update jingxuan_x set title=#{title},img=#{img},del=#{del},content=#{content} where id=#{id}")
    Integer update(JingXuan_x jingXuanX);

    @Delete("delete from jingxuan_x where id=#{id}")
    Integer delete(Integer id);
    public List<JingXuan_x> select(@Param("id") Integer id, @Param("title") String title);
}
